package com.hmall.mapper;

import com.hmall.model.ShopProduct;
import com.hmall.util.MyMapper;
import com.hmall.vo.ShopProductListVo;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface ShopProductMapper extends MyMapper<ShopProduct> {
    void updateCategoryStatus(@Param("categoryId") Integer categoryId);

    List<ShopProduct> selectByCategoryId(@Param("categoryId") Integer categoryId);

    Integer selectByCategoryIdAndTitle(@Param("categoryId")Integer categoryId,@Param("title") String title);

    Integer selectByCountKeyword(@Param("keyword") String keyword,@Param("shop_id") Integer shop_id);

    List<ShopProductListVo> selectByKeyword(@Param("keyword") String keyword, @Param("shop_id") Integer shop_id,@Param("pageStart") Integer pageStart,@Param("pageSize") Integer pageSize);

    void updateProductDetail(@Param("categoryId") Integer categoryId,@Param("detail") String detail,@Param("images") String images,@Param("shop_id") Integer shop_id);

    List<ShopProduct> selectByFilterItem(@Param("categoryId") Integer categoryId, @Param("AttrValueList") List<Integer> AttrValueList, @Param("size") int size, @Param("pageStart") Integer pageStart, @Param("pageSize") Integer pageSize);

    Integer selectCountByFilterItem(@Param("categoryId") Integer categoryId,@Param("AttrValueList") List<Integer> AttrValueList,@Param("size") int size);
}